<include file="./Tpl/Admin/header.html" />
<script language="javascript" src="/Public/plugin/kindeditor/jquery.tools.min.js"></script>
<script language="javascript" src="/Public/plugin/kindeditor/kindeditor-min.js"></script>
<script language="javascript" src="/Public/plugin/kindeditor/zh_CN.js"></script>
<div class="main">
	<div class="main_title">
		<img src="/Public/Admin/images/book1.gif"/>&nbsp;&nbsp;币种交易市场管理
	</div>
	<eq name="module" value="list">
	<div class="list_body">
	    <form action="?s=Admin/TypeBox/delAll" method="post" id="formid">
		<table cellspacing=0 cellpadding=0 border=0>
		    <tr>
			   <th width="5%">选择</th><th width="60%">交易市场名称</th><th width="5%">排序</th><th width="10%">操作</th>
			</tr>
			<volist name="list" id="vo">
			<tr>
			   <td><input type="checkbox" class="id" name="id[]" value="{$vo.id}"></td><td>{$vo.name1str} / {$vo.name2str}</td><td>{$vo.sort}</td><td><a href="?s=Admin/TypeBox/set/id/{$vo.id}">修改</a>&nbsp;&nbsp;<a href="?s=Admin/TypeBox/del/id/{$vo.id}">删除</a></td>
			</tr>
			</volist>
			<tr>
			    <td colspan=6 class="page">
				    <input type="button" id="all" value=" 全选 ">
					<input type="button" id="all_return" value=" 全不选 ">
					<input type="button" id="dels" value=" 批量删除 ">
					<input type="button" id="add" value=" 添加交易市场 ">
					<a href="?s=Admin/TypeBox/index/page/1">首页</a>
					<a href="?s=Admin/TypeBox/index/page/{$page-1}">上一页</a>
					<a href="?s=Admin/TypeBox/index/page/{$page+1}">下一页</a>
					<a href="?s=Admin/TypeBox/index/page/{$page_num}">尾页</a>
                </td>
			</tr>
		</table>
		</form>
	</div>
	<else/>
	<div class="main_body">
		<form action="?s=Admin/TypeBox/update" method="post">
		<input type="hidden" name="id" value="{$id}"/>
		<table cellspacing=0 cellpadding=0 border=0>
		<tr><td>交易市场名称</td><td>
			<select name="name1">
			    <option value="0">币种1</option>
			    <volist name="bts" id="vo">
			    <option value="{$vo.id}" <eq name="name1" value="$vo.id">selected</eq>>{$vo.name}</option>
				</volist>
			</select>
			/
			<select name="name2">
			    <option value="0">币种2</option>
			    <volist name="bts" id="vo">
			    <option value="{$vo.id}" <eq name="name2" value="$vo.id">selected</eq>>{$vo.name}</option>
				</volist>
			</select>
			卖出币种1，买入币种2
		</td></tr>
		<tr>
			<td>交易市场简介</td>
			<td>
				<textarea name="info" cols=100 rows=20>{$info}</textarea>
			</td>
		</tr>
		<tr><td>排序</td><td><input type="text" name="sort" value="{$sort?$sort:0}"/></td></tr>
		</table>
		<div><input type="submit" value="提交"/></div>
		</form>
    </div>
	</eq>
</div>
<include file="./Tpl/Admin/footer.html" />
<script language="javascript">
$(document).ready(function(){
    $('#all').click(function(){
	    $('.id').attr('checked',true);
	});
	$('#all_return').click(function(){
	    $('.id').attr('checked',false);
	});
    $('#dels').click(function(){

		f = 0;
	    $('.id').each(function(){
		    if($(this).attr('checked')) f = 1;
		});
		
        if(f==0){
		    alert('请选择要删除的项！');
		}else{
		    $('#formid').submit();
		}
	});
	$('#add').click(function(){
	    location.href="?s=Admin/TypeBox/add";
	});
});

	var editor;
	KindEditor.ready(function(K) {
		editor = K.create('textarea[name="info"]', {
			resizeType : 1,
			allowPreviewEmoticons : false,
			allowImageUpload : true,
			items : [
				'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
				'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
				'insertunorderedlist', '|', 'image', 'link']
		});
	});
</script>